<?php
namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Models\Feedback;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Session;

class FeedbackController extends Controller
{
    public function __construct()
    {
        $this->middleware('admin');
    }

    public function index(Request $request){
        $rows = Feedback::with('user')->paginate(20);
        $data = compact('rows');
        return view('admin/feedback/index',$data);
    }

    public function postDelete(Request $request){
        $id = intval($request->input('id'));
        Feedback::where('id')->delete();
        return $this->response('ok');
    }
}
